]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't declare global variables
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 24 Feb 2011 17:17:05 +0000 (18:17 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 24 Feb 2011 20:22:44 +0000 (21:22 +0100)
Fix a typo in panel.js, and ensure that all variables used in
functions are scoped to the block (using let), to avoid polluting
the global namespace.

https://bugzilla.gnome.org/show_bug.cgi?id=643210

js/ui/environment.js
js/ui/panel.js
js/ui/workspaceThumbnail.js

index d6405b3a38218a55c85bc29985e5e344db7e0c4a..e832262022a5597e54eebc391e06d799446dd965 100644 (file)
@@ -17,7 +17,7 @@ function _patchContainerClass(containerClass) {
     // This one is a straightforward mapping of the C method
     containerClass.prototype.child_set = function(actor, props) {
         let meta = this.get_child_meta(actor);
-        for (prop in props)
+        for (let prop in props)
             meta[prop] = props[prop];
     };
 
index a38bf9aa1d67f7d7cb8bf92100273ef5dd387f98..d1bf3fd4e5e770b9dfb0f3aedd4063d6990b3a9b 100644 (file)
@@ -410,7 +410,7 @@ AppMenuButton.prototype = {
         let [minSize, naturalSize] = this._iconBox.get_preferred_height(forWidth);
         alloc.min_size = minSize;
         alloc.natural_size = naturalSize;
-        [minSizfe, naturalSize] = this._label.actor.get_preferred_height(forWidth);
+        [minSize, naturalSize] = this._label.actor.get_preferred_height(forWidth);
         if (minSize > alloc.min_size)
             alloc.min_size = minSize;
         if (naturalSize > alloc.natural_size)
index 06dec6f6d6f4fe67f5c473f9a567e5f41ca8207b..d3acd3a5ed7a3a95d0717e8e44fd9378dfe54027 100644 (file)
@@ -424,7 +424,7 @@ ThumbnailsBox.prototype = {
         this._indicatorY = 0; // only used when _animatingIndicator is true
 
         this._stateCounts = {};
-        for (key in ThumbnailState)
+        for (let key in ThumbnailState)
             this._stateCounts[ThumbnailState[key]] = 0;
 
         this._thumbnails = [];
@@ -441,7 +441,7 @@ ThumbnailsBox.prototype = {
         this._stateUpdateQueued = false;
 
         this._stateCounts = {};
-        for (key in ThumbnailState)
+        for (let key in ThumbnailState)
             this._stateCounts[ThumbnailState[key]] = 0;
 
         // The "porthole" is the portion of the screen that we show in the workspaces